/*  */
function modification(target: Object, propertyKey: string, descriptor: PropertyDescriptor) {
    console.log(target);
    console.log("prop " + propertyKey);
    console.log("desc " + JSON.stringify(descriptor) + "\n\n");
};


class PersonV {

    // 约定俗成 _xxx是私有的
    private _name: string;

    constructor() {
        this._name = 'huihui';
    }

    /* 私有属性_name的访问器（getter + setter） */
    @modification
    get name() {
        console.log("get name");
        return this._name
    }
    set name(value: string) {
        console.log("set name", value);
        this._name = value
    }
}

const p50 = new PersonV()


p50.name = "lvlv"
console.log(p50.name);//huihui
